import React from 'react';
import ReactDOM from 'react-dom';
import {HashRouter as Router,Route,Switch} from 'react-router-dom';
import store from './redux/store';
window._store=store
import {Provider} from 'react-redux'

import Home from './containers/Home';
import Lesson from './containers/Lesson'
import Profile from './containers/Profile'
import App from './containers/App'
import Detail from './containers/Detail'
import Login from './containers/Login'
import Reg from './containers/Reg'
import './common/index.less'
import {ConnectedRouter} from 'react-router-redux';
import createHistory from 'history/createBrowserHistory';
let history = createHistory();
import PrivateRoute from './PrivateRoute'
ReactDOM.render(
    <Provider store={store}>
     <ConnectedRouter history={history}>
        <App>
            <Switch>
                <Route exact path="/" component={Home}/>
                <PrivateRoute path="/lesson" component={Lesson}/>
                {/* <Route path="/lesson" component={Lesson}/> */}
                <Route path="/profile" component={Profile}/>
                <Route path="/detail" component={Detail}/>
                <Route path="/login" component={Login}/>
                <Route path="/reg" component={Reg}/>
            </Switch>
        </App>
</ConnectedRouter></Provider>, document.querySelector('#app'));